#ifndef STATE_H
#define STATE_H

#include "Automat.h"

// State interface
class IState {
public:
	virtual ~IState() {
	}

	virtual TokenType operation(char c, Automat * a) = 0;
};

// Initial state
class StateStart: public IState {
private:
	StateStart() {
	}
	StateStart(const StateStart&);
	StateStart* operator=(const StateStart&);

public:
	virtual ~StateStart() {
	}

	static StateStart* makeState() {
		static StateStart state;
		return &state;
	}
	virtual TokenType operation(char c, Automat * a);
};

// Integer
class StateInteger: public IState {
private:
	StateInteger() {
	}
	StateInteger(const StateInteger&);
	StateInteger* operator=(const StateInteger&);

public:
	static StateInteger* makeState() {
		static StateInteger state;
		return &state;
	}

	virtual ~StateInteger() {
	}

	virtual TokenType operation(char c, Automat * a);
};

// Identifier
class StateIdentifier: public IState {
private:
	StateIdentifier() {
	}
	StateIdentifier(const StateIdentifier&);
	StateIdentifier* operator=(const StateIdentifier&);

public:
	static StateIdentifier* makeState() {
		static StateIdentifier state;
		return &state;
	}

	virtual ~StateIdentifier() {
	}

	virtual TokenType operation(char c, Automat * a);
};

// PARENS
// (
class StateOpenParen: public IState {
private:
	StateOpenParen() {
	}
	StateOpenParen(const StateOpenParen&);
	StateOpenParen* operator=(const StateOpenParen&);

public:
	static StateOpenParen* makeState() {
		static StateOpenParen state;
		return &state;
	}

	virtual ~StateOpenParen() {
	}

	virtual TokenType operation(char c, Automat * a);
};

// Comment start
// (*
class StateCommentBegin: public IState {
private:
	StateCommentBegin() {
	}
	StateCommentBegin(const StateCommentBegin&);
	StateCommentBegin* operator=(const StateCommentBegin&);

public:
	static StateCommentBegin* makeState() {
		static StateCommentBegin state;
		return &state;
	}

	virtual ~StateCommentBegin() {
	}

	virtual TokenType operation(char c, Automat * a);
};

// Comment end
// *)
class StateCommentEnd: public IState {
private:
	StateCommentEnd() {
	}
	StateCommentEnd(const StateCommentEnd&);
	StateCommentEnd* operator=(const StateCommentEnd&);

public:
	static StateCommentEnd* makeState() {
		static StateCommentEnd state;
		return &state;
	}

	virtual ~StateCommentEnd() {
	}

	virtual TokenType operation(char c, Automat * a);
};

// Less
// <
class StateSmaller: public IState {
private:
	StateSmaller() {
	}
	StateSmaller(const StateSmaller&);
	StateSmaller* operator=(const StateSmaller&);

public:
	static StateSmaller* makeState() {
		static StateSmaller state;
		return &state;
	}

	virtual ~StateSmaller() {
	}

	virtual TokenType operation(char c, Automat * a);
};

// <=>
class StatePossibleEqual: public IState {
private:
	StatePossibleEqual() {
	}
	StatePossibleEqual(const StatePossibleEqual&);
	StatePossibleEqual* operator=(const StatePossibleEqual&);

public:
	static StatePossibleEqual* makeState() {
		static StatePossibleEqual state;
		return &state;
	}

	virtual ~StatePossibleEqual() {
	}

	virtual TokenType operation(char c, Automat * a);
};

class StateSign: public IState {
private:
	StateSign() {
	}
	StateSign(const StateSign&);
	StateSign* operator=(const StateSign&);

public:
	static StateSign* makeState() {
		static StateSign state;
		return &state;
	}

	virtual ~StateSign() {
	}

	virtual TokenType operation(char c, Automat * a);
};

#endif
